<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      // 第一种
      function f1() {
        console.log("f1");
      }
      f1();

      function f2(name, age) {
        console.log(name + ":" + age);
      }
      f2("xiaoming", 18);

      function f3() {
        return "小明";
      }
      let result = f3();

      function f4(x, y) {
        return x * y;
      }
      let result2 = f4(8, 9);
      // 第二种
      let f5 = function (name, age) {
        console.log(name + ":" + age);
      };
      f5("小明", 20);
      // 第三种
      let f6 = new Function("name", "age", "console.log(name+':'+age)");
      f6("小明", 22);
    </script>
  </body>
</html>
